﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;

namespace LeonardoNews.Models
{
    [DataContract]
    public class Comment
    {
        [DataMember]
        public int ID { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public int UserID { get; set; }

        [DataMember]
        public virtual User User { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public virtual Article Article { get; set; }

        [DataMember]
        public string Text { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public virtual Comment ParentComment { get; set; }

        [DataMember(EmitDefaultValue=false)]
        public virtual ICollection<Comment> Children { get; set; }
    }
}
